package com.patzn.osgi.email.factory;

import com.patzn.osgi.email.api.IEmailService;
import com.patzn.osgi.email.service.v139.EmailService;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceRegistration;

public class EmailServiceFactory implements org.osgi.framework.ServiceFactory<IEmailService>{
    @Override
    public IEmailService getService(Bundle bundle, ServiceRegistration serviceRegistration) {
        System.out.println("bundle[" + bundle.getSymbolicName() + "] => serviceFactory get service");
        return new EmailService();
    }

    @Override
    public void ungetService(Bundle bundle, ServiceRegistration<IEmailService> serviceRegistration, IEmailService iEmailService) {

    }
}
